function EnterCom(parent)
    local scene = LoadJson("com.json");
    scene:setPosition(cc.p(0,0))
    parent:addChild(scene);
    
    scene.ui = scene.layer:getChildByName("Panel_1");
    LoadAllNode(scene, scene.layer);
    
    local oldLv = scene.ui:getChildByName("old");
    local newLv = scene.ui:getChildByName("new");
    
    local oldCom = EXCEL.com[g_Player.comLevel];
    local newCom = EXCEL.com[g_Player.comLevel+1];
    if not newCom then
        newCom = oldCom;
    end

    scene.star:setFntFile(EXCEL.const.comStarFontFile)
    scene.costHun:setFntFile(EXCEL.const.comCostSoulFontFile)
    scene.value:setFntFile(EXCEL.const.comTotalSoulFontFile)
    
    local function updateStatus()
        oldLv:loadTexture(oldCom.effectPng)
        newLv:loadTexture(newCom.effectPng)

        local i = 1;
        while true do
            local star = scene.ui:getChildByName("star"..i);
            if not star then
                break;
            end
            star:setVisible(i<=g_Player.comStar);
            local n = scene.ui:getChildByName("starBg"..i);
            if n then
                n:setVisible(i<=newCom.star);
            end
            i = i + 1;
        end
        
        scene.star:setString(newCom.star);
        scene.costHun:setString(newCom.soul);
        scene.value:setString(g_Player.items[CONST.items.soul]);
        
        local progress = scene.ui:getChildByName("progress");
        local percent = 100 * g_Player.comValue/newCom.starValue;
        progress:setPercent(percent);
    end
    updateStatus();
    
    local function upgradeCallBack(sender, eventType)
        if eventType == ccui.TouchEventType.ended then
            if not EXCEL.com[g_Player.comLevel+1] then
                return;
            end
            if g_Player.items[CONST.items.soul] < newCom.soul then
                
                return;
            end
            
            if ReduceItemData(CONST.items.soul, newCom.soul) then
                FlushSitem();
                
                AddConfigData("comValue", nil, newCom.value);
                if g_Player.comValue >= newCom.starValue then
                    ReduceConfigData("comValue", nil, newCom.starValue);
                    AddConfigData("comStar", nil, 1);
                    if g_Player.comStar >= newCom.star then
                        SetConfigData("comStar", nil, 0);
                        AddConfigData("comLevel", nil, 1);
                        
                        oldCom = EXCEL.com[g_Player.comLevel];
                        newCom = EXCEL.com[g_Player.comLevel+1];
                        if not newCom then
                            newCom = oldCom;
                        end
                    end
                end
                
                updateStatus();
            end
        end
    end
    local button = scene.ui:getChildByName("upgrade");
    SetButtonFunc(button, upgradeCallBack, "upgrade")
    button:setVisible(g_Player.comLevel < #EXCEL.com);
    scene.ui:getChildByName("upgradePng"):setVisible(g_Player.comLevel < #EXCEL.com);
        
    return scene;
end

